package cn.middle.application.portal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.middle.common.result.Page;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.middle.application.entity.EdgeService;
import cn.middle.application.service.EdgeServiceService;

@Controller
@RequestMapping("/edgeService")
public class EdgeServiceController {
	
	private final static String PREFIX = "edge/server/";
	
	@Autowired
	private EdgeServiceService edgeService;
	
	@SaCheckPermission("edgeService:list")
	@GetMapping("/list")
	public String list(@RequestParam(value = "page", defaultValue = "1") Integer pageNum,
			@RequestParam(value = "pageSize", defaultValue = "10") Integer limit, String serviceId,
			String serviceName, Byte status, ModelMap modelMap) {
		
		Page<EdgeService> servers = edgeService.listConditions(pageNum, limit, serviceId, serviceName, status);
		modelMap.put("serviceId", serviceId);
		modelMap.put("serviceName", serviceName);
		modelMap.put("status", status);
		modelMap.put("pageInfo", servers);
		return PREFIX + "list";
	}
	
	

}
